/**
* Box
*/
(function($){

$.fn.boxDraw = function(){
	return $(this).each( function(){
		$(this).one("draw_box", function(e,data,error,html){
									if(error){
										alert(error);
									}
									$(this).replaceWith( html );
									Core.Refresh();
									return false;
								} )
				.jsonRequest("BoxRequest", {action:"draw",
											atom_id:$(this).attr("atom_id")}, "draw_box" )
	});
};

Core.ObjectTypes["div.box"] = function(){
	var tmp = $(this).find(">input[type=hidden]:first");
	if ( tmp ){
		$(this).attr("atom_id", tmp.val() );
		tmp.remove();
	}
};

}(jQuery));

